package com.top4create.component;

import android.R;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;

import com.top4create.component.listener.ForwardListener;
import com.top4create.face.BasicActivity;
import com.top4create.face.ConpanyInfo;
import com.top4create.face.ConpanyInfoList;
import com.top4create.face.SellInfo;

/**
 * Created with IntelliJ IDEA.
 * User: Owen
 * Date: 12-8-22
 * Time: 下午2:43
 * To change this template use File | Settings | File Templates.
 */
public class MenuUtil {
    static final private String MENU_MAIN_TEXT1 = "menu1";

    public static boolean createMenu(Menu menu) {

        menu.add(0, Menu.FIRST, 0, MENU_MAIN_TEXT1).setIcon(android.R.drawable.ic_menu_save);
        menu.add(0, Menu.FIRST + 1, 1, MENU_MAIN_TEXT1).setIcon(android.R.drawable.ic_menu_save);
        menu.add(0, Menu.FIRST + 2, 2, MENU_MAIN_TEXT1).setIcon(android.R.drawable.ic_menu_send);
        menu.add(1, Menu.FIRST + 3, 3, MENU_MAIN_TEXT1).setIcon(android.R.drawable.ic_menu_send);
//        setMenuBackground();
        return true;
    }

    public static Intent createIntent4Menu(BasicActivity crtPage, Class<?> destPagClass) {
        Intent i = null;
        i = new Intent(crtPage, destPagClass);
        i.putExtra("key", "message");
        return i;
    }

    public static Intent createIntent4Forward(int pageType, BasicActivity crtPage, Class<?> destPagClass) {
        Intent i = null;
        i = new Intent(crtPage, destPagClass);
        i.putExtra("key", "message");
        return i;
    }
    
    public static void  forwardBind(View button,BasicActivity bscAct,Class<?> distClass){
        OnClickListener l=new ForwardListener(bscAct,distClass);
    	button.setOnClickListener(l);
    }


}
